home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / STRSET.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  425 b   |  19 lines

  1. /* strset.c From TC Bible page 298  Use strset to set all characters in a
  2. string excluding the terminating null, to a specific character */
  3.  
  4. #include <stdio.h>
  5. #include <string.h>
  6. #include <conio.h>
  7.  
  8. main()
  9. {
  10.     int c;
  11.     char buf[80];
  12.     printf("Enter a string: ");
  13.     gets(buf);
  14.     printf("Enter character you want entier string set to: ");
  15.     c = getche();
  16.     strset(buf, c);
  17.     printf("\nString is now: %s\n", buf);
  18. }
  19.